<template>
	<view class="template-mine tn-safe-area-inset-bottom">

		<view class="top-backgroup">
			<image src='/static/images/my/my-bg.png' mode='widthFix' class='backgroud-image'></image>
		</view>
		<view class="about__wrap">
			<!-- 图标logo/头像 -->
			<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin-bottom">
				<view class="justify-content-item">
					<view class="tn-flex tn-flex-col-center tn-flex-row-left" @click="$common.navigateTo('/pages/my/set')">
						<view class="logo-pic tn-shadow">
							<view class="logo-image">
								<tn-avatar class="tn-shadow-blur" style="width:100%;height:100%;" :src="userLogo"></tn-avatar>
							</view>
						</view>
						<view class="tn-padding-right" v-if="vuex_user">
							<view class="tn-padding-right tn-padding-left-sm tn-text-xl tn-text-bold">
								<text class="tn-color-brown--dark">{{vuex_user.nickname}}</text>
							</view>
							<view class="tn-padding-right tn-padding-top-xs tn-padding-left-sm tn-text-ellipsis">
								<text class="tn-color-brown tn-text-bold">{{vuex_user.mobile}}</text>
							</view>
						</view>

					</view>
				</view>
			</view>

			<!-- 方式12 start-->
			<view class="tn-flex">
				<view class="tn-flex-1 about-shadow tn-bg-white" style="margin: 30rpx 15rpx 0 0;padding: 30rpx 0;">
					<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
						<view class="icon20__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-orangered tn-color-white">
							<view class="tn-icon-computer-fill"></view>
						</view>
						<view class="tn-text-center" style="font-size: 30rpx;">
							<view class="tn-text-ellipsis">规划表</view>
						</view>
					</view>
				</view>
				<view class="tn-flex-1 about-shadow tn-bg-white" style="margin: 30rpx 0 0 15rpx;padding: 30rpx 0;">
					<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
						<view class="icon20__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur tn-bg-purplered tn-color-white">
							<view class="tn-icon-moon-fill"></view>
						</view>
						<view class="tn-text-center" style="font-size: 30rpx;">
							<view class="tn-text-ellipsis">素材库</view>
						</view>
					</view>
				</view>
			</view>

			<!-- 更多信息-->
			<view class="about-shadow tn-margin-top-xl tn-padding-top-sm tn-padding-bottom-sm tn-bg-white">
				<!-- 方式12 start-->
				<view class="tn-flex tn-flex-row-center tn-padding-top">
					<block v-for="(item,index) in gridList1" :key="index">
						<view class="tn-padding-sm tn-margin-xs" @click="$common.navigateTo(item.url)">
							<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
								<view class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-orange">
									<view :class="item.icon" style="color: #080808;"></view>
								</view>
								<view class="tn-text-center">
									<text class="tn-text-ellipsis">{{item.name}}</text>
								</view>
							</view>
						</view>
					</block>
				</view>
				<view class="tn-flex tn-flex-row-center  tn-padding-top">
					<block v-for="(item,index) in gridList2" :key="index">
						<view class="tn-padding-sm tn-margin-xs" @click="$common.navigateTo(item.url)">
							<view class="tn-flex tn-flex-direction-column tn-flex-row-center tn-flex-col-center">
								<view class="icon12__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-bg-orange">
									<view :class="item.icon" style="color: #080808;"></view>
								</view>
								<view class="tn-text-center">
									<text class="tn-text-ellipsis">{{item.name}}</text>
								</view>
							</view>
						</view>
					</block>
				</view>
				<!-- 方式12 end-->
			</view>

			<view class="about-shadow tn-margin-top-lg tn-margin-bottom-lg tn-padding-top-sm tn-padding-bottom-sm">
				<tn-list-cell :hover="true" :radius="true" :fontSize="30">
					<view class="tn-flex tn-flex-col-center" @click="$common.navigateTo('/pages/my/cooperate')">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-5 tn-color-white">
							<view class="tn-icon-wechat-fill"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">合作勾搭</view>
							<view class="tn-icon-trust"></view>
						</view>
					</view>
				</tn-list-cell>

				<tn-list-cell :hover="true" :radius="true" :fontSize="30">
					<view class="tn-flex tn-flex-col-center" @click="$common.navigateTo('/pages/my/money')">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-5 tn-color-white">
							<view class="tn-icon-wechat-fill"></view>
						</view>
						<view class="tn-flex tn-flex-row-between" style="width: 100%;">
							<view class="tn-margin-left-sm">请我喝杯奶茶</view>
							<view class="tn-icon-lucky-money"></view>
						</view>
					</view>
				</tn-list-cell>

				<tn-list-cell :hover="true" :unlined="true" :radius="true" :fontSize="30" @click="callPhoneNumber">
					<view class="tn-flex tn-flex-col-center">
						<view class="icon1__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-cool-bg-color-9 tn-color-white">
							<view class="tn-icon-phone-fill"></view>
						</view>
						<view class="tn-margin-left-sm tn-flex-1">技术支持</view>
						<view class="tn-margin-left-sm tn-color-orangered tn-text-sm tn-padding-left-xs tn-padding-right-xs tn-bg-orange--disabled tn-round">
							{{getSecTel}}
						</view>
					</view>
				</tn-list-cell>
			</view>
		</view>

		<view class='tn-tabbar-height'></view>
	</view>
</template>

<script>
	export default {
		name: 'My',
		data() {
			return {
				tel: '',
				recordCheckTypes: ['月收入', '年收入'],
				gridList1: [{
					name: "我的圈子",
					icon: "tn-icon-caring",
					url: "/pages/my/set"
				}, {
					name: "消息通知",
					icon: "tn-icon-message",
					url: "/pages/my/set"
				}, {
					name: "积分明细",
					icon: "tn-icon-ticket",
					url: "/pages/my/set"
				}, {
					name: "积分签到",
					icon: "tn-icon-calendar",
					url: "/pages/my/point"
				}],
				gridList2: [{
					name: "历史订单",
					icon: "tn-icon-order",
					url: "/pages/my/set"
				}, {
					name: "好物收藏",
					icon: "tn-icon-star",
					url: "/pages/my/set"
				}, {
					name: "收货地址",
					icon: "tn-icon-map",
					url: "/pages/my/set"
				}, {
					name: "全局设置",
					icon: "tn-icon-set",
					url: "/pages/my/set"
				}]
			}
		},
		created() {
			this.tel = uni.$biconfig.TEL;
		},
		computed: {
			userLogo() {
				if (this.vuex_user && this.vuex_user.avatar) {
					return uni.$biconfig.SERVER_URL + this.vuex_user.avatar;
				}
				return '/static/images/my/defaultUserLogo.png';
			},
			getSecTel() {
				return this.tel.slice(0, 3) + '****' + this.tel.slice(-4);
			}
		},
		methods: {
			//拨打固定电话
			callPhoneNumber() {
				uni.makePhoneCall({
					phoneNumber: this.tel,
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.template-mine {
		max-height: 100vh;
	}

	/* 顶部背景图 start */
	.top-backgroup {
		height: 300rpx;
		z-index: -1;

		.backgroud-image {
			width: 100%;
		}
	}

	/* 顶部背景图 end */

	/* 用户头像 start */
	.logo-image {
		width: 110rpx;
		height: 110rpx;
		position: relative;
	}

	.logo-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border: 8rpx solid rgba(255, 255, 255, 0.05);
		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}

	/* 页面 start*/
	.about-shadow {
		border-radius: 15rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
	}

	.about {

		&__wrap {
			position: relative;
			z-index: 1;
			margin: 20rpx 30rpx;
			margin-top: -180rpx;
		}
	}

	/* 页面 end*/

	.icon20 {
		&__item {
			width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 100rpx;
				height: 100rpx;
				font-size: 60rpx;
				border-radius: 50%;
				margin-bottom: 18rpx;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
					background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg.png);
				}
			}
		}
	}

	/* 图标容器12 start */
	.icon12 {
		&__item {
			width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 15rpx;
				height: 15rpx;
				font-size: 50rpx;
				border-radius: 50%;
				margin-bottom: 38rpx;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;

				}
			}
		}
	}

	/* 图标容器1 start */
	.icon1 {
		&__item {
			// width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 40rpx;
				height: 40rpx;
				font-size: 28rpx;
				border-radius: 50%;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
					background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg.png);
				}
			}
		}
	}
</style>